<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box{
      width:200px;
      height:200px;
      background-color: #5f7;
    }
  </style>
</head>
<body>
  <div id="app">
    <button @click="fn">按钮</button>
    <button @click="fn()">按钮</button>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app',
      methods: {
        fn(e){
          console.log(e)
          alert(1)
        }
      }
    })
    /*
    function fn(){} 
    btn.onclick = fn;

    btn.onclick = function(){
      fn()
    }
    */
  </script>
</body>
</html>